<template>
  <!-- hvps112明细-->
  <el-dialog :title="title" center :visible.sync="openState" width="1024px" :close-on-click-modal="false">
    <el-form ref="queryDetailForm111" :model="form" label-width="110px" :disabled="true">
      <!--交易础信息-->
      <el-card class="form-card txnInfo-card">
        <div slot="header" class="label-header-msg">
          <span>交易基础信息</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="交易流水号" prop="id">
              <el-input v-model="form.id" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="报文标识号" prop="mesId">
              <el-input v-model="form.mesId" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="行内流水号" prop="internalId1">
              <el-input v-model="form.internalId1" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="CPG日期" prop="cpgdate">
              <el-date-picker v-model="form.cpgdate" style="width: 100%;" type="date" value-format="yyyyMMdd" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工作日期" prop="workdate">
              <el-date-picker v-model="form.workdate" style="width: 100%;" type="date" value-format="yyyyMMdd" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="清算日期" prop="clrDate">
              <el-date-picker v-model="form.clrDate" style="width: 100%;" type="date" value-format="yyyyMMdd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="业务类型" prop="bizTypeCode">
              <el-select v-model="form.bizTypeCode" placeholder="业务类型">
                <el-option
                  v-for="dict in dictMap.BIZ_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select v-model="form.bizCtgyCode" placeholder="业务种类">
                <el-option
                  v-for="dict in dictMap.BIZ_CTGY"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务优先级" prop="bizPriority">
              <el-select v-model="form.bizPriority" placeholder="业务优先级">
                <el-option
                  v-for="dict in dictMap.PRIORITY3CODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="交易渠道" prop="source">
              <el-select v-model="form.source" placeholder="柜面交易" disabled>
                <el-option
                  v-for="dict in dictMap.TXN_SOURCE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="记账标志" prop="cbflag">
              <el-select v-model="form.cbflag" placeholder="记账标志">
                <el-option
                  v-for="dict in dictMap.CBFLAG"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="账户类型" prop="custflag1">
              <el-select v-model="form.custflag1" placeholder="账户类型">
                <el-option
                  v-for="dict in dictMap.CUST_FLAG1"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="原交易流水号" prop="oriId">
              <el-input v-model="form.oriId" placeholder="原交易流水号" :disabled="true"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="交易币种" prop="curcd">
              <el-input v-model="form.curcd" placeholder="人民币-CNY" :disabled="true" style="width: 195px" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="交易金额" prop="amount">
              <ht-amount-input v-model="form.amount" placeholder="交易金额" style="width: 195px"></ht-amount-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="大写金额" prop="bAmount">
              <ht-amount-upper :inputValue="form.amount" placeholder="交易金额" style="width: 195px"></ht-amount-upper>
            </el-form-item>
          </el-col>
        </el-row>

      </el-card>

      <!--付款人信息-->
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <el-input v-model="form.payerActno" placeholder="付款人账号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="付款人名称" prop="payerName">
            <el-input v-model="form.payerName" placeholder="付款人名称" />
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="付款人地址" prop="payerAddr">
            <el-input v-model="form.payerAddr" placeholder="付款人地址" />
          </el-form-item>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款行行号" prop="payerBrno">
                <el-input v-model="form.payerBrno" placeholder="付款行行号" />
              </el-form-item>
            </div>
          </el-col>

          <el-col :span="16">
            <el-form-item label="付款行行名" prop="payerBrName" label-width="130px">
              <el-input v-model="form.payerBrName" placeholder="付款行行名" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款人开户行号" prop="payerAccBrno">
                <el-input v-model="form.payerAccBrno" placeholder="付款人开户行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="付款人开户行行名" prop="payerAccBrName" label-width="130px">
              <el-input v-model="form.payerAccBrName" placeholder="付款人开户行行名" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--收款人信息-->
      <el-card class="form-card payeeInfo-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <div class="grid-payee">
              <el-form-item label="收款人账号" prop="payeeActno">
                <el-input v-model="form.payeeActno" placeholder="收款人账号" />
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-form-item label="收款人名称" prop="payeeName">
          <el-input v-model="form.payeeName" placeholder="收款人名称" />
        </el-form-item>
        <el-form-item label="收款人地址" prop="payeeAddr">
          <el-input v-model="form.payeeAddr" placeholder="收款人地址" />
        </el-form-item>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款行行号" prop="payeeBrno">
                <el-input v-model="form.payeeBrno" placeholder="收款行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="收款行行名" prop="payeeBrName" label-width="130px">
              <el-input v-model="form.payeeBrName" placeholder="收款行行名" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款人开户行号" prop="payeeAccBrno">
                <el-input v-model="form.payeeAccBrno" placeholder="收款人开户行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="收款人开户行行名" prop="payeeAccBrName" label-width="130px">
              <el-input v-model="form.payeeAccBrName" placeholder="收款人开户行行名" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--其他信息-->
      <el-card class="form-card payOtherInfo-card">
        <div slot="header" class="label-header-msg">
          <span>其他交易信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-otherInfo">
              <el-form-item label="中介机构1" prop="agency1">
                <el-input v-model="form.agency1" placeholder="中介机构1" />
              </el-form-item>
            </div>
          </el-col>

          <el-col :span="16">
            <el-form-item label="中介机构1名称" prop="agency1name" label-width="130px">
              <el-input v-model="form.agency1name" placeholder="中介机构1名称" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-otherInfo">
              <el-form-item label="中介机构2" prop="agency2">
                <el-input v-model="form.agency2" placeholder="中介机构2" />
              </el-form-item>
            </div>
          </el-col>

          <el-col :span="16">
            <el-form-item label="中介机构2名称" prop="agency2name" label-width="130px">
              <el-input v-model="form.agency2name" placeholder="中介机构2名称" />
            </el-form-item>
          </el-col>
        </el-row>
<!--        <el-row>-->
<!--          <el-col :span="24">-->
<!--            <div class="grid-otherInfo">-->
<!--              <el-form-item label="备注" prop="remarks">-->
<!--                <el-input type="textarea" v-model="form.remarks" placeholder="备注" maxlength="140" show-word-limit />-->
<!--              </el-form-item>-->
<!--            </div>-->
<!--          </el-col>-->
<!--        </el-row>-->
        <el-row>
          <el-col :span="24">
            <div class="grid-otherInfo">
              <el-form-item label="附言" prop="remarks">
                <el-input type="textarea" v-model="form.remarks" placeholder="附言" maxlength="210" show-word-limit />
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row v-if="form.bizTypeCode == 'A115'">
          <el-col :span="24">
            <el-form-item label="再贷款合同号" prop="e2eId" label-width="110px">
              <el-input v-model="form.e2eId" placeholder="再贷款合同号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="form.bizTypeCode == 'A116'">
          <el-col :span="24">
            <el-form-item label="再贴现结算票据号码" prop="e2eId" label-width="140px">
              <el-input v-model="form.e2eId" placeholder="再贴现结算票据号码" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--附加信息域 根据业务类型，动态显示或隐藏-->
      <!--附加信息域 根据业务类型，动态显示或隐藏-->
      <el-card class="form-card payAddInfo-card" v-show="form.bizTypeCode === 'A200'">
        <div slot="header" class="label-header-msg">
          <span>行间资金汇划</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="拆借利率(单位:万分之一)" prop="lendIntRate" label-width="150px">
              <el-input v-model="form.lendIntRate" placeholder="拆借利率" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="拆借期限" prop="lendDline" label-width="110px">
              <el-input v-model="form.lendDline" placeholder="拆借期限" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--跨境支付转移动CIPS-->
      <el-card class="form-card payAddInfo-card" v-show="form.bizTypeCode === 'A113'">
        <div slot="header" class="label-header-msg">
          <span>跨境支付附加域信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="关联业务委托日期" prop="cbBizAssocBizDate" label-width="120px">
              <el-date-picker
                style="width: 185px"
                v-model="form.cbBizAssocBizDate"
                type="date"
                placeholder="选择日期"
                value-format="yyyyMMdd"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <!--当业务类型为“跨境支付”时：“端到端标识号”填写内容为“关联业务参考号-->
            <el-form-item label="关联业务参考号" prop="e2eId" label-width="110px">
              <el-input v-model="form.e2eId" placeholder="关联业务参考号" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payAddInfo">
              <el-form-item label="费用编码" prop="cbBizFeeCode" label-width="120px">
                <el-input v-model="form.cbBizFeeCode" placeholder="费用编码" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-payAddInfo">
              <el-form-item label="发报行的收费" prop="cbBizSndBnkFee" label-width="110px">
                <el-input v-model="form.cbBizSndBnkFee" placeholder="发报行的收费" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-payAddInfo">
              <el-form-item label="收报行的收费" prop="cbBizRcvBnkFee" label-width="110px">
                <el-input v-model="form.cbBizRcvBnkFee" placeholder="收报行的收费" />
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-form-item label="跨境业务附言" prop="cbBizRemark" label-width="120px">
              <el-input
                type="textarea"
                v-model="form.cbBizRemark"
                placeholder="跨境业务附言"
                maxlength="135"
                show-word-limit
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card payAddInfo-card" v-show="form.bizTypeCode === 'A119'">
        <div slot="header" class="label-header-msg">
          <span>广西非截留票据业务</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="交换日期" prop="chgDate" label-width="110px">
              <el-date-picker
                style="width: 185px"
                v-model="form.chgDate"
                type="date"
                placeholder="交换日期"
                value-format="yyyyMMdd"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="交换场次" prop="chgField" label-width="110px">
              <el-input v-model="form.chgField" placeholder="交换场次" style="width: 185px" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="提出交换区域" prop="outRegionid" label-width="110px">
              <el-select style="width: 100%" v-model="form.outRegionid" placeholder="提出交换区域">
                <el-option
                  v-for="dict in dictMap.RegionId"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="提入交换区域" prop="inRegionid" label-width="110px">
              <el-select style="width: 100%" v-model="form.inRegionid" placeholder="提入交换区域">
                <el-option
                  v-for="dict in dictMap.RegionId"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <query-detail-inter-info
        ref="detailInterInfo"
        :dataDetail="this.form"
        :dictMap="dictMap"
      ></query-detail-inter-info>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleClose">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { detail } from "@/api/cnaps/baseBiz/send/sendCommon.js";
import HtAmountInput from "@/views/components/HtAmountInput";
import HtAmountUpper from "@/views/components/HtAmountUpper";
import QueryDetailInterInfo from "./queryDetailInterInfo";

export default {
  name: "QueryDetailDialog",
  components: {
    HtAmountInput,
    HtAmountUpper,
    QueryDetailInterInfo,
  },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      busTypeList: [],
      id: "",
      pkgNo: "",
      title: "",
      // 是否显示弹出层
      openState: false,

      // 表单参数
      form: {
        amount: "0.00",
      },
    };
  },
  mounted() {},
  methods: {
    // 关闭回掉
    handleClose() {
      this.openState = false;
    },
    show(id, pkgNo) {
      this.openState = true;
      if (id) {
        this.title = "大额金融机构发起汇兑明细";
        detail({
          coreId: id,
          pkgNo: pkgNo,
        }).then((res) => {
          this.$set(this, "form", res.result.detail6402DataModel);
        });
      }
    },

    cancel() {
      this.openState = false;
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
